-
Notifications
You must be signed in to change notification settings - Fork 52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Support OFED with DTK #711
Conversation
Note that the API with MOFED container is not finalized yet. |
2c6b188
to
52ed808
Compare
pkg/state/state_ofed_test.go
Outdated
} | ||
|
||
func (d *openShiftClusterProvider) GetClusterType() clustertype.Type { | ||
return clustertype.Kubernetes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: switch to clusterType.Openshift
to be consistent with what the methods below return.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
864d53f
to
a274a04
Compare
/retest-blackduck_scan |
@@ -447,6 +447,7 @@ containerResources: | |||
| `ofedDriver.upgradePolicy.waitForCompletion.podSelector` | string | not set | specifies a label selector for the pods to wait for completion before starting the driver upgrade | | |||
| `ofedDriver.upgradePolicy.waitForCompletion.timeoutSeconds` | int | not set | specify the length of time in seconds to wait before giving up for workload to finish, zero means infinite | | |||
| `ofedDriver.containerResources` | [] | not set | Optional [resource requests and limits](#container-resources) for the `mofed-container` container | | |||
| `ofedDriver.useOcpDriverToolkit` | bool | `true` | In OpenShift, use Driver Toolkit image to compile OFED drivers | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
prevent setting to this to true in validation webhook if we are not in openshift ? WDYT ?
i.e if not openshift and this is true -> fail CR create/update
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i now remember we discussed the flow :) so maybe we should just ignore this on non openshift
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
alternative: dont introduce any API changes for this in CRD, add ENV var in operator (DISABLE_DTK or similar)
since for openshift we do want dtk to always run. in special cases where we dont, we can deploy operator with this env var.
this is best option imo as going forward we either want dtk or precompiled
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed from Helm
@@ -226,6 +226,7 @@ ofedDriver: | |||
# podSelector: "app=myapp" | |||
# specify the length of time in seconds to wait before giving up for workload to finish, zero means infinite | |||
# timeoutSeconds: 300 | |||
useOcpDriverToolkit: true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we really want to have this defined in values ?
(also i dont see we use it in the nicclusterpolicy CR template)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed from helm
pkg/state/state_ofed.go
Outdated
@@ -735,3 +753,27 @@ func (s *stateOFED) handleRepoConfig( | |||
} | |||
return nil | |||
} | |||
|
|||
// getOCPDriverToolkitImage gets the DTK ImageStream and return the DTK image according to RHCOS version | |||
func (s *stateOFED) getOCPDriverToolkitImage(ctx context.Context, rhcosVersion string) (string, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rhcosVersion -> ostreeVersion
this exists also for rhel (OSTREE_VERSION) i assume.
and we should support dtk on rhel as well right ?
OSTREE_VERSION="412.86.202301311551-0"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Renamed
{{- end }} | ||
{{- end }} | ||
volumeMounts: | ||
{{- if.AdditionalVolumeMounts.VolumeMounts }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we need additional mounts for DTK ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed
2bc57ff
to
e21665e
Compare
/retest-nic_operator_kind |
In Openshift, in order to OFED containter to be able to download and compile the needed Kernel files, it is required to install a cluster-wide entitlement. This requirement is not user friendly. In order to avoid this, a container image with the needed files is available in Openshift distributions. This image is called DriverToolKit aka DTK. By using this container as a side-car to MOFED container, the modules can be compiled without entitlement. Changes: API: - DTK is 'true' by default, and can be changed by env variable in the Operator Deployment OFED state: - In case of OCP and 'useOcpDriverToolkit' is true, find DTK image based on NFD label of node. - If available, add to MOFED DS a DTK container, change entrypoint logic. Signed-off-by: Fred Rolland <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
/retest-nic_operator_kind |
@e0ne @adrianchiris Can we have this in the beta? |
In Openshift, in order to OFED containter to be able to download and compile the needed Kernel files, it is required to install a cluster-wide entitlement.
This requirement is not user friendly.
In order to avoid this, a container image with the needed files is available in Openshift distributions.
This image is called DriverToolKit aka DTK.
By using this container as a side-car to MOFED container, the modules can be compiled without entitlement.
Changes:
API:
variable in the Operator Deployment
OFED state: